// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_activity;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.AsyncTask;
import android.os.PowerManager;
import android.preference.Preference;
import com.nnee.p_a.p_a.cls_e;
import com.nnee.p_g.cls_b;
import com.nnee.p_pr.p_a.cls_f;
import com.nnee.p_pr.p_a.cls_h;
import com.nnee.p_pr.p_a.cls_i;
import java.io.File;

// Referenced classes of package com.nnee.p_pr.p_activity:
//            PRISActivitySetting, en, ea

class cls_l extends AsyncTask
{

    public cls_l(cls_PRISActivitySetting prisactivitysetting, Context context, int j, int k)
    {
        e = prisactivitysetting;
        super();
        i = 1;
        f = context;
        g = j;
        h = ((PowerManager)f.getSystemService("power")).newWakeLock(1, "CacheClearTask");
        i = k;
    }

    protected transient Integer a(Void avoid[])
    {
        String s;
        String s1;
        Exception exception;
        long l1;
        File file;
        String as[];
        int j;
        long l2;
        int k;
        Integer integer;
        Integer integer1;
        Integer integer2;
        File file1;
        boolean flag;
        Integer integer3;
        Integer integer4;
        if(i == 1)
        {
            String s4 = com.nnee.p_a.p_a.cls_e.b();
            s = com.nnee.p_a.p_a.cls_e.c();
            s1 = s4;
        } else
        if(i == 2)
        {
            String s3 = com.nnee.p_a.p_a.cls_e.d();
            s = com.nnee.a.a.e.e();
            s1 = s3;
        } else
        {
            s = null;
            s1 = null;
        }
        h.acquire();
        if(g != 2)
            break MISSING_BLOCK_LABEL_724;
        l1 = com.nnee.p_pr.p_a.cls_f.e(new File(s1)) + com.nnee.p_pr.p_a.cls_e.b();
_L10:
        com.nnee.p_a.p_a.cls_e.c(s);
        com.nnee.p_pr.a.i.f(s);
        file = new File(s1);
        if(file.exists()) goto _L2; else goto _L1
_L1:
        if(i != 1) goto _L4; else goto _L3
_L3:
        com.nnee.p_pr.p_c.cls_i.a(e, null);
_L5:
        integer4 = Integer.valueOf(1);
        integer1 = integer4;
        if(h != null && h.isHeld())
        {
            h.release();
            h = null;
        }
        com.nnee.p_a.p_a.cls_e.b(s1);
        com.nnee.p_a.p_a.cls_e.b(s);
_L6:
        return integer1;
_L4:
        com.nnee.p_pr.p_c.cls_i.b(e, null);
          goto _L5
        exception;
        if(h != null && h.isHeld())
        {
            h.release();
            h = null;
        }
        com.nnee.p_a.p_a.cls_e.b(s1);
        com.nnee.p_a.p_a.cls_e.b(s);
        throw exception;
_L2:
        as = file.list();
        if(as != null)
            break MISSING_BLOCK_LABEL_318;
        j = 0;
_L7:
        if(j != 0)
            break MISSING_BLOCK_LABEL_326;
        String as2[] = new String[2];
        as2[0] = String.valueOf(100);
        as2[1] = "0";
        publishProgress(as2);
        integer3 = Integer.valueOf(3);
        integer1 = integer3;
        if(h != null && h.isHeld())
        {
            h.release();
            h = null;
        }
        com.nnee.p_a.p_a.cls_e.b(s1);
        com.nnee.p_a.p_a.cls_e.b(s);
          goto _L6
        j = as.length;
          goto _L7
        com.nnee.p_a.p_a.cls_e.a(s1);
        cls_PRISActivitySetting.c(e).setMax(j);
        l2 = 0L;
        k = 0;
_L8:
        if(k >= j)
            break MISSING_BLOCK_LABEL_576;
label0:
        {
            synchronized(cls_PRISActivitySetting.d(e))
            {
                if(!com.nnee.p_pr.p_activity.cls_PRISActivitySetting.e(e))
                    break label0;
                com.nnee.p_g.cls_b.c("doInBackground", "user cancel\uFF01");
                cls_PRISActivitySetting.a(e, false);
                integer1 = Integer.valueOf(0);
            }
            if(h != null && h.isHeld())
            {
                h.release();
                h = null;
            }
            com.nnee.p_a.p_a.cls_e.b(s1);
            com.nnee.p_a.p_a.cls_e.b(s);
        }
          goto _L6
        obj;
        JVM INSTR monitorexit ;
        file1 = new File(s1, as[k]);
        flag = file1.exists();
        if(flag)
        {
            String s2;
            String as1[];
            if(file1.isFile())
                l2 += file1.length();
            else
            if(file1.isDirectory())
                l2 += com.nnee.p_pr.p_a.cls_f.e(file1);
            com.nnee.p_a.p_a.cls_e.a(file1);
            s2 = com.nnee.p_pr.p_a.cls_f.a(f, l2);
            as1 = new String[2];
            as1[0] = String.valueOf(k + 1);
            as1[1] = s2;
            publishProgress(as1);
        }
        k++;
          goto _L8
        exception1;
        obj;
        JVM INSTR monitorexit ;
        throw exception1;
        if(i != 1)
            break MISSING_BLOCK_LABEL_663;
        com.nnee.p_pr.p_c.cls_i.a(e, null);
_L9:
        com.nnee.p_a.p_a.cls_e.c(s1);
        if(g != 2 || l1 > 0x300000L)
            break MISSING_BLOCK_LABEL_674;
        integer2 = Integer.valueOf(2);
        integer1 = integer2;
        if(h != null && h.isHeld())
        {
            h.release();
            h = null;
        }
        com.nnee.p_a.p_a.cls_e.b(s1);
        com.nnee.p_a.p_a.cls_e.b(s);
          goto _L6
        com.nnee.p_pr.p_c.cls_i.b(e, null);
          goto _L9
        integer = Integer.valueOf(1);
        integer1 = integer;
        if(h != null && h.isHeld())
        {
            h.release();
            h = null;
        }
        com.nnee.p_a.p_a.cls_e.b(s1);
        com.nnee.p_a.p_a.cls_e.b(s);
          goto _L6
        l1 = 0L;
          goto _L10
    }

    protected void a(Integer integer)
    {
        if(integer.intValue() == 2)
        {
            com.nnee.p_pr.p_a.cls_h.a(f, 0x7f0a00fd);
            integer = Integer.valueOf(1);
        }
        if(integer.intValue() == 1)
        {
            String s = com.nnee.p_pr.p_a.cls_f.a(f, 0L);
            PRISActivitySetting prisactivitysetting6 = e;
            Object aobj2[] = new Object[1];
            aobj2[0] = s;
            String s1 = prisactivitysetting6.getString(0x7f0a010e, aobj2);
            Preference preference1;
            PRISActivitySetting prisactivitysetting3;
            Object aobj1[];
            PRISActivitySetting prisactivitysetting4;
            PRISActivitySetting prisactivitysetting5;
            Context context1;
            String as1[];
            if(i == 1)
                cls_PRISActivitySetting.a(e).setSummary(s1);
            else
            if(i == 2)
                com.nnee.p_pr.p_activity.cls_PRISActivitySetting.b(e).setSummary(s1);
        }
        if(integer.intValue() == 0)
        {
            com.nnee.p_pr.p_a.cls_h.a(f, 0x7f0a0119);
            if(i == 1)
            {
                preference1 = cls_PRISActivitySetting.a(e);
                prisactivitysetting3 = e;
                aobj1 = new Object[1];
                aobj1[0] = e.getString(0x7f0a0116);
                preference1.setSummary(prisactivitysetting3.getString(0x7f0a010e, aobj1));
                prisactivitysetting4 = e;
                prisactivitysetting5 = e;
                context1 = f;
                as1 = new String[2];
                as1[0] = com.nnee.p_a.p_a.cls_e.b();
                as1[1] = com.nnee.p_a.p_a.cls_e.c();
                cls_PRISActivitySetting.a(prisactivitysetting4, new en(prisactivitysetting5, context1, 1, as1));
                com.nnee.p_pr.p_activity.cls_PRISActivitySetting.f(e).execute(new Void[0]);
            } else
            if(i == 2)
            {
                Preference preference = com.nnee.p_pr.p_activity.cls_PRISActivitySetting.b(e);
                PRISActivitySetting prisactivitysetting = e;
                Object aobj[] = new Object[1];
                aobj[0] = e.getString(0x7f0a0116);
                preference.setSummary(cls_PRISActivitySetting.getString(0x7f0a010e, aobj));
                PRISActivitySetting prisactivitysetting1 = e;
                PRISActivitySetting prisactivitysetting2 = e;
                Context context = f;
                String as[] = new String[2];
                as[0] = com.nnee.p_a.p_a.cls_e.d();
                as[1] = com.nnee.a.a.e.e();
                com.nnee.p_pr.p_activity.cls_PRISActivitySetting.b(prisactivitysetting1, new en(prisactivitysetting2, context, 2, as));
                cls_PRISActivitySetting.g(e).execute(new Void[0]);
            }
        }
        if(integer.intValue() != 3);
        f = null;
        if(cls_PRISActivitySetting.c(e) != null)
        {
            cls_PRISActivitySetting.c(e).dismiss();
            cls_PRISActivitySetting.a(e, null);
        }
    }

    protected transient void a(String as[])
    {
        super.onProgressUpdate(as);
        int j = Integer.valueOf(as[0]).intValue();
        cls_PRISActivitySetting.c(e).setProgress(j);
        ProgressDialog progressdialog = cls_PRISActivitySetting.c(e);
        PRISActivitySetting prisactivitysetting = e;
        Object aobj[] = new Object[1];
        aobj[0] = as[1];
        progressdialog.setMessage(cls_PRISActivitySetting.getString(0x7f0a0117, aobj));
    }

    protected Object doInBackground(Object aobj[])
    {
        return a((Void[])aobj);
    }

    protected void onPostExecute(Object obj)
    {
        a((Integer)obj);
    }

    protected void onPreExecute()
    {
        cls_PRISActivitySetting.a(e, new ProgressDialog(f));
        cls_PRISActivitySetting.c(e).setMax(100);
        cls_PRISActivitySetting.c(e).setProgressStyle(1);
        ProgressDialog progressdialog = cls_PRISActivitySetting.c(e);
        PRISActivitySetting prisactivitysetting = e;
        Object aobj[] = new Object[1];
        aobj[0] = e.getString(0x7f0a0118);
        progressdialog.setMessage(cls_PRISActivitySetting.getString(0x7f0a0117, aobj));
        cls_PRISActivitySetting.c(e).setCancelable(false);
        cls_PRISActivitySetting.c(e).setButton(-2, e.getString(0x7f0a0105), new ea(this));
        cls_PRISActivitySetting.c(e).show();
    }

    protected void onProgressUpdate(Object aobj[])
    {
        a((String[])aobj);
    }

    public static final int a = 0;
    public static final int b = 1;
    public static final int c = 2;
    public static final int d = 3;
    final PRISActivitySetting e;
    private Context f;
    private int g;
    private android.os.PowerManager.WakeLock h;
    private int i;
}
